<template>
  <div>
    <button @click="isShow = !isShow">显示/隐藏</button>
    <transition name="hello" appear>
      <h1 v-show="isShow">Hello World！</h1>
    </transition>
  </div>
</template>

<script>
export default {
  name: "Test",
  data() {
    return {
      isShow: true
    };
  },
  props: {},
  computed: {},
  components: {},
  methods: {},
  mixins: [],
  watch: {},
  filters: {},
  directives: {}
}
</script>

<style scoped>
h1 {
  background-color: orange;
}

.hello-enter-active {
  animation: move1 1s;
}

.hello-leave-active {
  animation: move1 1s reverse;
}

@keyframes move1 {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}
</style>